import Check from "../../Core/Check.js";
import QuarkGIS3DTilesInspector from "../QuarkGIS3DTilesInspector/QuarkGIS3DTilesInspector.js";

/**
 * A mixin which adds the {@link QuarkGIS3DTilesInspector} widget to the {@link Viewer} widget.
 * Rather than being called directly, this function is normally passed as
 * a parameter to {@link Viewer#extend}, as shown in the example below.
 * @function
 *
 * @param {Viewer} viewer The viewer instance.
 *
 * @example
 * var viewer = new QuarkGIS.Viewer('quarkgisContainer');
 * viewer.extend(QuarkGIS.viewerQuarkGIS3DTilesInspectorMixin);
 */
function viewerQuarkGIS3DTilesInspectorMixin(viewer) {
  //>>includeStart('debug', pragmas.debug);
  Check.typeOf.object("viewer", viewer);
  //>>includeEnd('debug');

  var container = document.createElement("div");
  container.className = "quarkgis-viewer-quarkgis3DTilesInspectorContainer";
  viewer.container.appendChild(container);
  var quarkgis3DTilesInspector = new QuarkGIS3DTilesInspector(
    container,
    viewer.scene
  );

  Object.defineProperties(viewer, {
    quarkgis3DTilesInspector: {
      get: function () {
        return quarkgis3DTilesInspector;
      },
    },
  });
}
export default viewerQuarkGIS3DTilesInspectorMixin;
